<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script>
        var _hmt = _hmt || [];
        (function () {
            var hm = document.createElement("script");
            hm.src = "https://hm.baidu.com/hm.js?3f7568fbcc9cdcdd5a59e02bfa882176";
            var s = document.getElementsByTagName("script")[0];
            s.parentNode.insertBefore(hm, s);
        })();
    </script>
</head>

<body>
    <button id="btn">注册/登录</button>
    <script>
        document.getElementById('btn').addEventListener('click', function () {
            console.log(window._hmt);

            _hmt.push(['_trackEvent', 'login', 'click', "用户登录成功"])
        })
    </script>
</body>

</html>